package com.ruoyi.system.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.AttendanceMapper;
import com.ruoyi.system.domain.Attendance;
import com.ruoyi.system.service.IAttendanceService;
import com.ruoyi.common.core.text.Convert;

/**
 * 考勤Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-12-15
 */
@Service
public class AttendanceServiceImpl implements IAttendanceService 
{
    @Autowired
    private AttendanceMapper attendanceMapper;

    /**
     * 查询考勤
     * 
     * @param attendanceID 考勤主键
     * @return 考勤
     */
    @Override
    public Attendance selectAttendanceByAttendanceID(Long attendanceID)
    {
        return attendanceMapper.selectAttendanceByAttendanceID(attendanceID);
    }

    /**
     * 查询考勤列表
     * 
     * @param attendance 考勤
     * @return 考勤
     */
    @Override
    public List<Attendance> selectAttendanceList(Attendance attendance)
    {
        return attendanceMapper.selectAttendanceList(attendance);
    }

    /**
     * 新增考勤
     * 
     * @param attendance 考勤
     * @return 结果
     */
    @Override
    public int insertAttendance(Attendance attendance)
    {
        return attendanceMapper.insertAttendance(attendance);
    }

    /**
     * 修改考勤
     * 
     * @param attendance 考勤
     * @return 结果
     */
    @Override
    public int updateAttendance(Attendance attendance)
    {
        return attendanceMapper.updateAttendance(attendance);
    }

    /**
     * 批量删除考勤
     * 
     * @param attendanceIDs 需要删除的考勤主键
     * @return 结果
     */
    @Override
    public int deleteAttendanceByAttendanceIDs(String attendanceIDs)
    {
        return attendanceMapper.deleteAttendanceByAttendanceIDs(Convert.toStrArray(attendanceIDs));
    }

    /**
     * 删除考勤信息
     * 
     * @param attendanceID 考勤主键
     * @return 结果
     */
    @Override
    public int deleteAttendanceByAttendanceID(Long attendanceID)
    {
        return attendanceMapper.deleteAttendanceByAttendanceID(attendanceID);
    }
}
